package com.calque;

import java.util.ArrayList;

import java.util.List;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

import com.activity.MyApplicationMainActivity;
import com.geo.GeoTools;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class MyPositionCalque extends ItemizedOverlay<OverlayItem> {
	private List<OverlayItem> items = new ArrayList<OverlayItem>();
	private Drawable marker = null;

	public MyPositionCalque(Drawable marker, Context context) {
		super(marker);
		this.marker = marker;

		items.add(new OverlayItem(GeoTools.makeGeoPoint(
				MyApplicationMainActivity.mLatitude,
				MyApplicationMainActivity.mLongitude), "Moi", "Je suis ici"));

		populate();

	}

	@Override
	protected OverlayItem createItem(int i) {
		return (items.get(i));
	}

	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		super.draw(canvas, mapView, false);
		boundCenterBottom(marker);
	}

	@Override
	protected boolean onTap(int i) {

		return (true);
	}

	@Override
	public int size() {

		return (items.size());
	}

}